package tw.edu.tku.im.maze;
import org.json.JSONException;
import org.json.JSONObject;


public class HeartBeatReqParser extends PacketParser {
   public static HeartBeatReqParser INSTANCE = new HeartBeatReqParser();
   
   private HeartBeatReqParser() { }

   @Override
   public HeartBeatReq parse(JSONObject jsonObj) throws JSONException {
      JSONObject parameter = jsonObj.getJSONObject("parameter");
      String userID = parameter.getString("userID");
      int ticket = parameter.getInt("ticket");
      return new HeartBeatReq(userID, ticket);
   }

   @Override
   public String acceptName() {
      return null;
   }
}
